const inquirer = require("inquirer");
const t = require("../../config/dict");

module.exports = (context) => {
  return inquirer
    .prompt([
      {
        name: "projectMode",
        message:
          [t(context.lang, "手动"), "/", t(context.lang, "自动")].join(" ") +
          "?",
        default: "manual",
        pageSize: 3,
        type: "rawlist",
        choices: t(context.lang, [
          {
            name: "手动",
            value: "manual",
          },
          {
            name: "自动",
            value: "auto",
          },
        ]),
      },
    ])
    .then((answers) => {
      context.metadata = {
        ...(context.metadata || {}),
        projectMode: answers.projectMode,
      };
      return context;
    });
};
